﻿Shader "Custom/TestShader20"
{
	Properties
	{
		_MainTex ("Texture", 2D) = "white" {}
        _BlurAmount("BlurAmount", float) = 1
    }
    SubShader
    {
        CGINCLUDE
        #include "UnityCG.cginc"
        sampler2D _MainTex;
        float4 _MainTex_ST;
        float _BlurAmount;

        struct v2f
        {
            float4 pos : SV_POSITION;
            float2 uv : TEXCOORD0;
        };

        v2f vert(appdata_img v)
        {
            v2f o;
            o.pos = UnityObjectToClipPos(v.vertex);
            o.uv = v.texcoord;
            return o;
        }

        fixed4 fragRGB(v2f i) : SV_Target
        {
            fixed3 color = tex2D(_MainTex, i.uv).rgb;
            return fixed4(color, _BlurAmount);
        }

        fixed4 fragA(v2f i) : SV_Target
        {
            return tex2D(_MainTex, i.uv);
        }

        ENDCG
        ZWrite Off
        Cull Off
        ZTest Always

        Pass
        {
            Blend SrcAlpha OneMinusSrcAlpha
            ColorMask RGB
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment fragRGB
            ENDCG
        }

        Pass
        {
            Blend One Zero
            ColorMask A
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment fragA
            ENDCG
        }
	}
}
